package com.colorfruit;

import com.colorfruit.framework.model.OauthClientDetails;
import com.colorfruit.framework.model.vo.RespCode;
import com.colorfruit.framework.model.vo.RespVo;
import com.colorfruit.service.BaseClientRemoteService;
import org.springframework.cloud.openfeign.FeignClient;

import java.util.List;

/**
 * Created by xiehf on 2018/4/9.
 */
@FeignClient(name = InterfaceService.SERVICE_NAME, fallback = BaseClientService.HystrixClientFallback.class)
public interface BaseClientService extends BaseClientRemoteService {

    class HystrixClientFallback implements BaseClientService {

        @Override
        public RespVo<List<OauthClientDetails>> getAllClient() {
            return RespVo.error(RespCode.ERROR.getCode(), RespCode.ERROR.getMessage());
        }
    }
}
